package com.ke.jun.view.widght

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
import android.util.AttributeSet
import android.view.View

class TestPahtView@JvmOverloads constructor
    (context: Context, attributeSet: AttributeSet?=null,
     defStyleAttr:Int=0): View(context,attributeSet,defStyleAttr) {
    private var paint=Paint()
    private var path=Path()
    init {
        with(paint){
            color= Color.RED
            isAntiAlias=true
            style=Paint.Style.STROKE
            strokeWidth=5f
        }

        with(path){
//            addCircle(300f,300f,100f,Path.Direction.CCW)
//            addOval(900f,900f,200f,400f,Path.Direction.CCW)
//            lineTo(100f,100f)
//            rLineTo(100f,0f)

//            moveTo(100f,100f)
//            lineTo(200f,100f)
//            lineTo(150f,150f)
//            close()

            addCircle(300f,300f,200f,Path.Direction.CW)
            addCircle(300F,300f,100f,Path.Direction.CW)


        }
    }


    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)
//         canvas.drawPath(path,paint)
//        canvas.drawBitmap()



    }

}